#ifndef DRAGHANDLER_H
#define DRAGHANDLER_H

#include <QObject>
#include <QMouseEvent>
#include <QWidget>

class DragHandler : public QObject
{
    Q_OBJECT
public:
    explicit DragHandler(QWidget *parent);

protected:
    bool eventFilter(QObject *watched, QEvent *event) override;

private:
    bool mousePressEvent(QMouseEvent *event);

    bool mouseMoveEvent(QMouseEvent *event);

    bool mouseReleaseEvent(QMouseEvent *event);

private:
    QWidget *m_parentWidget;
    bool m_dragging = false;
    QPoint m_dragPosition;

};

#endif // DRAGHANDLER_H
